<?php

/**
 * 模块安装，菜单/权限配置
 * @copyright (c) 2013, Mr.Wang
 * 
 */
defined('INSTALL') or exit('Access Denied');
//添加一个菜单到后台“模块->模块列表”ID等于常量 MENUID
$parentid = M("Menu")->add(array(
    //父ID
    "parentid"  => MENUID,
    //模块目录名称，也是项目名称
    "app"       => "DevHelper",
    //文件名称，比如LinksAction.class.php就填写 Links
    "model"     => "Index",
    //方法名称
    "action"    => "index",
    //附加参数 例如：a=12&id=777
    "data"      => "",
    //类型，后台是1。
    "type"      => 1,
    //状态，1是显示，2是不显示
    "status"    => 1,
    //名称
    "name"      => "开发者便捷工具",
    //备注
    "remark"    => "开发者便捷工具",
    //排序
    "listorder" => 0
        ));

//添加其他需要加入权限认证的方法，后台进行权限认证时不通过。
//提示：比如一些删除，修改这类方法需要配合参数使用，该类不适合直接显示出来，可以把status设置为0
M("Menu")->add(array("parentid"  => $parentid, "app"       => "DevHelper", "model"     => "DevHelper", "action"    => "add", "data"      => "", "type"      => 1, "status"    => 1, "name"      => "添加表单", "remark"    => "", "listorder" => 0));
M("Menu")->add(array("parentid"  => $parentid, "app"       => "DevHelper", "model"     => "DevHelper", "action"    => "edit", "data"      => "", "type"      => 1, "status"    => 0, "name"      => "编辑", "remark"    => "", "listorder" => 0));
M("Menu")->add(array("parentid"  => $parentid, "app"       => "DevHelper", "model"     => "DevHelper", "action"    => "delete", "data"      => "", "type"      => 1, "status"    => 0, "name"      => "删除", "remark"    => "", "listorder" => 0));
M("Menu")->add(array("parentid"  => $parentid, "app"       => "DevHelper", "model"     => "DevHelper", "action"    => "status", "data"      => "", "type"      => 1, "status"    => 0, "name"      => "禁用", "remark"    => "", "listorder" => 0));

$InfoID = M("Menu")->add(array("parentid"  => $parentid, "app"       => "DevHelper", "model"     => "Info", "action"    => "index", "data"      => "", "type"      => 1, "status"    => 0, "name"      => "信息列表", "remark"    => "", "listorder" => 0));
M("Menu")->add(array("parentid"  => $InfoID, "app"       => "DevHelper", "model"     => "Info", "action"    => "delete", "data"      => "", "type"      => 1, "status"    => 0, "name"      => "删除", "remark"    => "", "listorder" => 0));

$FieldID = M("Menu")->add(array("parentid"  => $parentid, "app"       => "DevHelper", "model"     => "Field", "action"    => "index", "data"      => "", "type"      => 1, "status"    => 0, "name"      => "管理字段", "remark"    => "", "listorder" => 0));
M("Menu")->add(array("parentid"  => $FieldID, "app"       => "DevHelper", "model"     => "Field", "action"    => "add", "data"      => "", "type"      => 1, "status"    => 0, "name"      => "添加字段", "remark"    => "", "listorder" => 0));
M("Menu")->add(array("parentid"  => $FieldID, "app"       => "DevHelper", "model"     => "Field", "action"    => "edit", "data"      => "", "type"      => 1, "status"    => 0, "name"      => "编辑字段", "remark"    => "", "listorder" => 0));
M("Menu")->add(array("parentid"  => $FieldID, "app"       => "DevHelper", "model"     => "Field", "action"    => "delete", "data"      => "", "type"      => 1, "status"    => 0, "name"      => "删除字段", "remark"    => "", "listorder" => 0));
?>